﻿@model SYJ.Model.Entities.SysLeaves 
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

    <title></title>
    <link href="~/Content/layui/css/layui.css" rel="stylesheet" />
    <script src="~/Scripts/jquery-1.11.3.min.js"></script>
    <script src="~/Content/layui/layui.js"></script>
    <script src="~/Scripts/Common.js"></script>

</head>
<body class="layui-container" >
    <div class="layui-row">


        <form class="layui-form" action="" method="post">
            <input type="hidden" id="id" name="id" value="@Model.id" />
         
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">留言人</label>
                        <div class="layui-input-inline">
                            <input type="text" name="create_author" id="create_author" value="@Model.create_author" class="layui-input" disabled />
                                   
                        </div>
                        </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">留言类型</label>
                        <div class="layui-input-inline">
                            <input type="text" name="typeStr" id="typeStr" value="@Model.typeStr" class="layui-input" disabled />
                        </div>
                    </div>
                </div>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">联系方式</label>
                    <div class="layui-input-inline">
                      <input type="text" name="contact" id="contact" value="@Model.contact" class="layui-input" disabled />
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">留言时间</label>
                    <div class="layui-input-inline">
                      <input type="text" name="create_time" id="create_time" value="@Model.create_time" class="layui-input" disabled />
                    </div>
                </div>
            </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">标题</label>
                    <div class="layui-input-block">
                   <input type="text" name="title" id="title" value="@Model.title" class="layui-input"  />
                    </div>
                </div>
            <div class="layui-form-item">
                <label class="layui-form-label">留言内容</label>
                <div class="layui-input-block">
                    <textarea name="explain"  class="layui-textarea" disabled> @Model.explain </textarea>
                </div>
            </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">留言状态</label>
                    <div class="layui-input-block">
                        <select name="status" id="status">
                            <option value="0">已提交</option>
                            <option value="1">已回复</option>
                            <option value="2">已显示</option>
                            <option value="3">已隐藏</option>
                        </select>
                    </div>
                </div>
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label">回复内容</label>
                <div class="layui-input-block">
                    <textarea name="reply" placeholder="请输入回复内容" class="layui-textarea"> @Model.reply </textarea>
                </div>
            </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit lay-filter="form1" type="button">立即提交</button>
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>
</form>
    </div>
         <script>

             layui.use(['form', 'jquery'], function () {
                 var form = layui.form;
                 var $ = layui.jquery;
                 var status = '@Model.status';
                 debugger;
                 if (status == null || status == "") {
                     status = 0;
                 }
                 $("#status").val(status);

                 form.render('select'); //刷新select选择框渲染


                 //监听提交
                 form.on('submit(form1)', function (data) {
                     $.ajax({
                         type: "POST",
                         url: '/admin/SysleavesMgr/AddOrUp',
                         data: data.field,
                         dataType: "json",
                         //traditional: true, //传数组进后台需要设置该属性
                         success: function (data) {
                             if (data) {
                                 layer.msg("操作成功,2秒后自动关闭", function () {
                                     parent.layui.table.reload('tid');
                                     //当你在iframe页面关闭自身时
                                     var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                                     parent.layer.close(index); //再执行关闭
                                 });
                             }
                             else {
                                 layer.msg("操作失败");
                             }
                         }
                     });
                     return false;
                 });

             });
    </script>
</body>



</html>